@alwith/module-chat 0.6.13 → 0.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/README.md +63 -0
  2. package/dist/activity-host.js +1 -1
  3. package/dist/app-reference.js +1 -1
  4. package/dist/application-tools.d.ts +42 -0
  5. package/dist/application-tools.js +1 -0
  6. package/dist/approval/choice-elicitation-form.js +1 -1
  7. package/dist/approval/choice-schema.js +1 -1
  8. package/dist/approval/permission-options.js +1 -1
  9. package/dist/approval/permission-view.js +1 -1
  10. package/dist/approval/schema-elicitation-form.js +1 -1
  11. package/dist/approval/url-elicitation-card.js +1 -1
  12. package/dist/{chunk-7wgt5rjw.js → chunk-00z352ph.js} +2 -2
  13. package/dist/{chunk-2s5598rk.js → chunk-0307kp7e.js} +2 -2
  14. package/dist/{chunk-8a1th59e.js → chunk-04vnhbvc.js} +2 -2
  15. package/dist/{chunk-1tb3d2x4.js → chunk-05eg5p11.js} +2 -2
  16. package/dist/{chunk-sygx6n0s.js → chunk-0yqb54zg.js} +2 -2
  17. package/dist/{chunk-vk7kqa6a.js → chunk-11cbk1je.js} +2 -2
  18. package/dist/{chunk-rhxyb55x.js → chunk-11z072sz.js} +2 -2
  19. package/dist/chunk-1e7gk302.js +2 -0
  20. package/dist/chunk-1renytb3.js +3 -0
  21. package/dist/chunk-1xaskqdj.js +2 -0
  22. package/dist/chunk-2drcx544.js +2 -0
  23. package/dist/{chunk-j7w4jr8y.js → chunk-2pahy4hs.js} +2 -2
  24. package/dist/{chunk-pr5wv14q.js → chunk-2ptyqcf3.js} +2 -2
  25. package/dist/chunk-2ss8m0ja.js +4 -0
  26. package/dist/chunk-2sxxr6j8.js +2 -0
  27. package/dist/chunk-2tc9kn50.js +2 -0
  28. package/dist/{chunk-9n2wwk4g.js → chunk-3174p320.js} +2 -2
  29. package/dist/{chunk-mxh0vcye.js → chunk-3h3cmjh2.js} +2 -2
  30. package/dist/chunk-3karja82.js +2 -0
  31. package/dist/{chunk-hqdbv5hw.js → chunk-3t5cksae.js} +2 -2
  32. package/dist/{chunk-290e7g1q.js → chunk-3yq0a0f1.js} +2 -2
  33. package/dist/{chunk-f2wy8jza.js → chunk-41v0g6sw.js} +2 -2
  34. package/dist/{chunk-5zq0s9fd.js → chunk-4dabfz24.js} +3 -3
  35. package/dist/{chunk-1sxmqb44.js → chunk-4gq7ye1a.js} +2 -2
  36. package/dist/{chunk-rtdjp07m.js → chunk-4hz2ax5w.js} +2 -2
  37. package/dist/chunk-4jy404m1.js +2 -0
  38. package/dist/{chunk-87br10bq.js → chunk-4n4gap45.js} +1 -1
  39. package/dist/{chunk-24dqkjvg.js → chunk-4qghztvg.js} +2 -2
  40. package/dist/chunk-4zz6dnqa.js +2 -0
  41. package/dist/chunk-5m45z6qm.js +4 -0
  42. package/dist/{chunk-mzwwsacy.js → chunk-5r909639.js} +2 -2
  43. package/dist/{chunk-2wex96dp.js → chunk-5wsyenq9.js} +2 -2
  44. package/dist/chunk-5ygdb72w.js +2 -0
  45. package/dist/{chunk-8c7x6vrs.js → chunk-5ymq8y72.js} +3 -3
  46. package/dist/{chunk-fgre64ge.js → chunk-620q6hmz.js} +2 -2
  47. package/dist/chunk-6283nzqs.js +2 -0
  48. package/dist/{chunk-wz6a2j26.js → chunk-64wzvf7k.js} +2 -2
  49. package/dist/{chunk-b5jq0ken.js → chunk-6es8tgxc.js} +2 -2
  50. package/dist/{chunk-vxn8gfy4.js → chunk-6xds0dkq.js} +2 -2
  51. package/dist/{chunk-5s85tvas.js → chunk-7919s3et.js} +2 -2
  52. package/dist/chunk-7cv512vy.js +2 -0
  53. package/dist/{chunk-sjes4cxr.js → chunk-7eqtvqrn.js} +2 -2
  54. package/dist/{chunk-m7exm1n3.js → chunk-7h3f7s97.js} +5 -5
  55. package/dist/chunk-7hwg9r4y.js +2 -0
  56. package/dist/{chunk-3pcbgsm6.js → chunk-7nehhgej.js} +2 -2
  57. package/dist/{chunk-ggkjq8rk.js → chunk-82xjggwn.js} +2 -2
  58. package/dist/chunk-856bck34.js +2 -0
  59. package/dist/{chunk-1bt8a25d.js → chunk-8djjctdj.js} +2 -2
  60. package/dist/{chunk-8jgstab4.js → chunk-8weq6t3q.js} +2 -2
  61. package/dist/{chunk-y3mk12gg.js → chunk-9072bnjm.js} +2 -2
  62. package/dist/chunk-95n1cpnj.js +2 -0
  63. package/dist/{chunk-v28fv6c4.js → chunk-97tgc9ym.js} +2 -2
  64. package/dist/{chunk-1mf3b58j.js → chunk-9eme3n5c.js} +2 -2
  65. package/dist/chunk-9h77fcpn.js +2 -0
  66. package/dist/{chunk-vdc46qt2.js → chunk-9hmqa3cs.js} +2 -2
  67. package/dist/{chunk-fnvjemhq.js → chunk-9pcx42v8.js} +2 -2
  68. package/dist/{chunk-r9szj8sp.js → chunk-9rf3qecr.js} +2 -2
  69. package/dist/chunk-9rvf1am9.js +2 -0
  70. package/dist/{chunk-pnavf2zs.js → chunk-9xhw5zmq.js} +2 -2
  71. package/dist/{chunk-q4f8zazc.js → chunk-9z9jffth.js} +2 -2
  72. package/dist/{chunk-zxwvq5f4.js → chunk-a1k3ffay.js} +2 -2
  73. package/dist/chunk-aaqk0jrt.js +2 -0
  74. package/dist/{chunk-6fvrhr9x.js → chunk-adc8e01w.js} +2 -2
  75. package/dist/{chunk-eeqppv9j.js → chunk-b9q9d2jh.js} +3 -3
  76. package/dist/chunk-bc6e3dhv.js +2 -0
  77. package/dist/{chunk-y8sc8n3j.js → chunk-bnpwhf5c.js} +2 -2
  78. package/dist/{chunk-7cj104ba.js → chunk-bqbpded2.js} +2 -2
  79. package/dist/chunk-bsra0akd.js +4 -0
  80. package/dist/{chunk-yzhqbz2p.js → chunk-c05dxz9x.js} +2 -2
  81. package/dist/{chunk-vpzjhbfa.js → chunk-csgkwny6.js} +2 -2
  82. package/dist/chunk-ct0xqakr.js +2 -0
  83. package/dist/chunk-d1n4w7hn.js +2 -0
  84. package/dist/{chunk-btrg3ywt.js → chunk-d924by6g.js} +2 -2
  85. package/dist/{chunk-r9ny4bqk.js → chunk-dcevaazr.js} +2 -2
  86. package/dist/{chunk-nxjr0z23.js → chunk-ehmdmfs5.js} +2 -2
  87. package/dist/{chunk-acmc2r2s.js → chunk-ev9tkjgy.js} +3 -3
  88. package/dist/chunk-f0kgxjp1.js +2 -0
  89. package/dist/{chunk-rb4p3h5b.js → chunk-f2jc13bq.js} +2 -2
  90. package/dist/chunk-fd72zzqm.js +4 -0
  91. package/dist/chunk-fjk1g303.js +2 -0
  92. package/dist/chunk-fjseqvmx.js +1 -0
  93. package/dist/{chunk-jpm15hcd.js → chunk-fvz27k62.js} +2 -2
  94. package/dist/{chunk-0xmj4d4z.js → chunk-fzze5xcw.js} +2 -2
  95. package/dist/{chunk-0d0bfb8e.js → chunk-gbc31gbf.js} +2 -2
  96. package/dist/{chunk-53ptmmsx.js → chunk-gee5kh24.js} +2 -2
  97. package/dist/chunk-gez0k8zs.js +7 -0
  98. package/dist/chunk-gjfhvaxn.js +2 -0
  99. package/dist/{chunk-z9ch23p0.js → chunk-gk0tq3n9.js} +2 -2
  100. package/dist/{chunk-pfqz31kk.js → chunk-gxjg94y5.js} +2 -2
  101. package/dist/{chunk-bqdnxftw.js → chunk-h3xn4d48.js} +2 -2
  102. package/dist/chunk-h4xxyhpn.js +4 -0
  103. package/dist/{chunk-y8md080p.js → chunk-h7ackcd4.js} +2 -2
  104. package/dist/{chunk-z8ymt0ny.js → chunk-ha5xrc0a.js} +2 -2
  105. package/dist/chunk-hmet2d96.js +2 -0
  106. package/dist/{chunk-5ykpe629.js → chunk-hn6f6yrp.js} +2 -2
  107. package/dist/{chunk-mmywt5fq.js → chunk-hqykt9hr.js} +2 -2
  108. package/dist/{chunk-vkbaa74h.js → chunk-hwvr7b0j.js} +2 -2
  109. package/dist/{chunk-8t1brzbh.js → chunk-j5njgy7p.js} +2 -2
  110. package/dist/{chunk-2761tcb3.js → chunk-j6r44m9g.js} +2 -2
  111. package/dist/chunk-j9snfndd.js +2 -0
  112. package/dist/chunk-jz6zecb7.js +2 -0
  113. package/dist/{chunk-wj2xjzds.js → chunk-k86843av.js} +2 -2
  114. package/dist/{chunk-r6b9fdnm.js → chunk-kcra1mgf.js} +2 -2
  115. package/dist/chunk-kp7qa98m.js +2 -0
  116. package/dist/{chunk-3tsy36rq.js → chunk-m2x1s408.js} +2 -2
  117. package/dist/{chunk-zntkqbcv.js → chunk-mgsxsaj1.js} +2 -2
  118. package/dist/{chunk-jzyj96ws.js → chunk-mhxgws9c.js} +2 -2
  119. package/dist/chunk-ncwf6pjj.js +3 -0
  120. package/dist/{chunk-cdgfr4n0.js → chunk-netp71kb.js} +2 -2
  121. package/dist/chunk-nh9gk065.js +2 -0
  122. package/dist/{chunk-8wydj0hv.js → chunk-nszq1xrj.js} +2 -2
  123. package/dist/chunk-nxj8m5bm.js +2 -0
  124. package/dist/chunk-p0d6rr6q.js +2 -0
  125. package/dist/chunk-pn5ghg65.js +2 -0
  126. package/dist/chunk-pvd09dx5.js +2 -0
  127. package/dist/{chunk-rvjfb004.js → chunk-pwcw4zp2.js} +2 -2
  128. package/dist/{chunk-7xc69d48.js → chunk-q3vvg0de.js} +2 -2
  129. package/dist/{chunk-rq7t6qry.js → chunk-qdgsg6v4.js} +2 -2
  130. package/dist/chunk-qkw2nhsr.js +4 -0
  131. package/dist/{chunk-cctw9m9a.js → chunk-qm1z1zcw.js} +2 -2
  132. package/dist/{chunk-h1embxgj.js → chunk-qnbr2cmg.js} +2 -2
  133. package/dist/{chunk-ba4fa6fc.js → chunk-qtft8hnb.js} +2 -2
  134. package/dist/{chunk-3ab38s9g.js → chunk-qwtmwj5m.js} +2 -2
  135. package/dist/chunk-rncx5gxz.js +2 -0
  136. package/dist/{chunk-z94nsbnw.js → chunk-rvmbvv03.js} +2 -2
  137. package/dist/chunk-s5c2ha8t.js +2 -0
  138. package/dist/{chunk-rge2pazt.js → chunk-sct2h2dm.js} +2 -2
  139. package/dist/chunk-segftqt4.js +2 -0
  140. package/dist/{chunk-snee6rb9.js → chunk-sg681jnt.js} +4 -4
  141. package/dist/{chunk-x2ayy0ys.js → chunk-sp411z4y.js} +4 -4
  142. package/dist/{chunk-6g5z3pff.js → chunk-sqm2vsf5.js} +2 -2
  143. package/dist/chunk-t4dsmqdq.js +2 -0
  144. package/dist/{chunk-cx1sg5dt.js → chunk-t94rfs41.js} +2 -2
  145. package/dist/{chunk-06yzz0yx.js → chunk-t96rf4pg.js} +2 -2
  146. package/dist/chunk-thhtbvj1.js +2 -0
  147. package/dist/{chunk-j71h60r0.js → chunk-tjfjvzv5.js} +2 -2
  148. package/dist/{chunk-1g54ee1j.js → chunk-tkbs5ev1.js} +1 -1
  149. package/dist/{chunk-xary32dg.js → chunk-trh02gwn.js} +2 -2
  150. package/dist/{chunk-3ddgyzhz.js → chunk-tvbgjmtw.js} +3 -3
  151. package/dist/{chunk-782x5ryb.js → chunk-twbeapwa.js} +2 -2
  152. package/dist/{chunk-mdp2zdqm.js → chunk-twx75z08.js} +2 -2
  153. package/dist/{chunk-6tkjdrnj.js → chunk-tz8wmvs9.js} +2 -2
  154. package/dist/{chunk-tbv1mfdg.js → chunk-v0y5fepf.js} +3 -3
  155. package/dist/{chunk-jgseey5x.js → chunk-v2mdhm11.js} +3 -3
  156. package/dist/chunk-vctq22tq.js +2 -0
  157. package/dist/chunk-veb90k24.js +2 -0
  158. package/dist/chunk-vepv6ktb.js +2 -0
  159. package/dist/{chunk-d51rg15n.js → chunk-vextf7ba.js} +2 -2
  160. package/dist/chunk-vjmgh1q9.js +2 -0
  161. package/dist/{chunk-b8c460mr.js → chunk-vkc8ssbv.js} +2 -2
  162. package/dist/chunk-vmg3evhm.js +2 -0
  163. package/dist/{chunk-a953k2dj.js → chunk-vnr9rqs6.js} +3 -3
  164. package/dist/{chunk-st0gd22t.js → chunk-vqkwvrxc.js} +2 -2
  165. package/dist/{chunk-ehhzhjyb.js → chunk-vypkwd0x.js} +2 -2
  166. package/dist/{chunk-rhcpe6m6.js → chunk-w22ch68s.js} +2 -2
  167. package/dist/chunk-wdacgfwp.js +2 -0
  168. package/dist/{chunk-y7gzr914.js → chunk-wv127h6d.js} +2 -2
  169. package/dist/{chunk-xw2zfj4c.js → chunk-wyndwb68.js} +2 -2
  170. package/dist/{chunk-cqskn18r.js → chunk-x0h0g1ma.js} +2 -2
  171. package/dist/{chunk-tme1d6xh.js → chunk-x6f51rt2.js} +2 -2
  172. package/dist/{chunk-8xn58z0x.js → chunk-xbp4r3n4.js} +3 -3
  173. package/dist/chunk-xmks1g9y.js +2 -0
  174. package/dist/{chunk-k5cjaeza.js → chunk-xmpaqxer.js} +2 -2
  175. package/dist/chunk-xqwbn2ph.js +2 -0
  176. package/dist/{chunk-pjgym6rx.js → chunk-xtwpbvdx.js} +2 -2
  177. package/dist/{chunk-bp6f5tv8.js → chunk-y1fpm5r2.js} +2 -2
  178. package/dist/chunk-y6kxhkjm.js +2 -0
  179. package/dist/{chunk-djk0ebpk.js → chunk-y7n8m9st.js} +2 -2
  180. package/dist/{chunk-rvbbb9rf.js → chunk-yaxsff9s.js} +2 -2
  181. package/dist/chunk-yy1pm240.js +2 -0
  182. package/dist/chunk-z38xf1rw.js +5 -0
  183. package/dist/{chunk-xztxaq9k.js → chunk-z7ehwkcq.js} +2 -2
  184. package/dist/chunk-zah0npdy.js +2 -0
  185. package/dist/chunk-zcwsc0gx.js +2 -0
  186. package/dist/{chunk-f8tv9m81.js → chunk-zq18ffn0.js} +2 -2
  187. package/dist/client.d.ts +20 -1
  188. package/dist/client.js +1 -1
  189. package/dist/codex/activity-group.js +1 -1
  190. package/dist/codex/assistant-message.js +1 -1
  191. package/dist/codex/async-question-card.js +1 -1
  192. package/dist/codex/disclosure-state.js +1 -1
  193. package/dist/codex/edited-files-card.js +1 -1
  194. package/dist/codex/image-view-activity.js +1 -1
  195. package/dist/codex/markdown-renderer.js +1 -1
  196. package/dist/codex/navigation-audio.js +1 -1
  197. package/dist/codex/navigation-preview.js +1 -1
  198. package/dist/codex/navigation-rail.js +1 -1
  199. package/dist/codex/patch-view.js +1 -1
  200. package/dist/codex/plan.js +1 -1
  201. package/dist/codex/timeline-virtualizer.js +1 -1
  202. package/dist/codex/turn-activity.js +1 -1
  203. package/dist/codex/user-message.js +1 -1
  204. package/dist/codex/virtualized-turn-list.js +1 -1
  205. package/dist/collections/collection-emoji.js +1 -1
  206. package/dist/collections/collection-menu.js +1 -1
  207. package/dist/collections/collection-panel.js +1 -1
  208. package/dist/collections/collections.js +1 -1
  209. package/dist/collections/host.js +1 -1
  210. package/dist/collections/locales.js +1 -1
  211. package/dist/collections/model.js +1 -1
  212. package/dist/collections/store.js +1 -1
  213. package/dist/composer/completion-filter.js +1 -1
  214. package/dist/composer/completion-menu.d.ts +9 -2
  215. package/dist/composer/completion-menu.js +1 -1
  216. package/dist/composer/completion-trigger.js +1 -1
  217. package/dist/composer/effort-slider.js +1 -1
  218. package/dist/composer/inline-document.js +1 -1
  219. package/dist/composer/inline-dom.d.ts +2 -1
  220. package/dist/composer/inline-dom.js +1 -1
  221. package/dist/composer/menu-presentation.d.ts +12 -0
  222. package/dist/composer/menu-presentation.js +1 -0
  223. package/dist/composer/menu-radio.js +1 -1
  224. package/dist/composer/model-select.js +1 -1
  225. package/dist/composer/permission-mode-select.js +1 -1
  226. package/dist/composer/prompt-input-attachments.js +1 -1
  227. package/dist/composer/prompt-input-clipboard.js +1 -1
  228. package/dist/composer/prompt-input-context.js +1 -1
  229. package/dist/composer/prompt-input-inline.d.ts +3 -1
  230. package/dist/composer/prompt-input-inline.js +1 -1
  231. package/dist/composer/prompt-input-textarea.d.ts +2 -1
  232. package/dist/composer/prompt-input-textarea.js +1 -1
  233. package/dist/composer/prompt-input.js +1 -1
  234. package/dist/conversation/action-card.js +1 -1
  235. package/dist/conversation/composer/app-mentions.js +1 -1
  236. package/dist/conversation/composer/apps-menu.js +1 -1
  237. package/dist/conversation/composer/composer-menu.d.ts +24 -0
  238. package/dist/conversation/composer/composer-menu.js +1 -0
  239. package/dist/conversation/composer/composer.js +1 -1
  240. package/dist/conversation/composer/config-options.js +1 -1
  241. package/dist/conversation/composer/context.js +1 -1
  242. package/dist/conversation/composer/drafts.js +1 -1
  243. package/dist/conversation/composer/long-text.js +1 -1
  244. package/dist/conversation/composer/mention-chips.js +1 -1
  245. package/dist/conversation/composer/mention-uri.js +1 -1
  246. package/dist/conversation/composer/model-menu.js +1 -1
  247. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  248. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  249. package/dist/conversation/composer/prompt-history.js +1 -1
  250. package/dist/conversation/composer/slash-command-button.js +1 -1
  251. package/dist/conversation/composer/submit-button.js +1 -1
  252. package/dist/conversation/composer/usage-meter.js +1 -1
  253. package/dist/conversation/connection-notice.js +1 -1
  254. package/dist/conversation/context.js +1 -1
  255. package/dist/conversation/conversation-body.js +1 -1
  256. package/dist/conversation/conversation-search.js +1 -1
  257. package/dist/conversation/conversation-view.js +1 -1
  258. package/dist/conversation/conversation.js +1 -1
  259. package/dist/conversation/diff-modal.js +1 -1
  260. package/dist/conversation/draft-project-picker.js +1 -1
  261. package/dist/conversation/session-actions.js +1 -1
  262. package/dist/conversation/subagent-sessions.js +1 -1
  263. package/dist/conversation/subagent-tasks.js +1 -1
  264. package/dist/generated/commands.js +1 -1
  265. package/dist/image-lightbox.js +1 -1
  266. package/dist/image-preview-dialog.js +1 -1
  267. package/dist/image.js +1 -1
  268. package/dist/lib/app-reference.js +1 -1
  269. package/dist/lib/application-metadata.js +1 -1
  270. package/dist/lib/code-highlighter.js +1 -1
  271. package/dist/lib/file-url.js +1 -1
  272. package/dist/lib/fuzzy.js +1 -1
  273. package/dist/lib/group-blocks.js +1 -1
  274. package/dist/lib/image-encode.js +1 -1
  275. package/dist/lib/limits.js +1 -1
  276. package/dist/lib/markdown-parser.js +1 -1
  277. package/dist/lib/markdown-rules.js +1 -1
  278. package/dist/lib/model-name.js +1 -1
  279. package/dist/lib/pointer-centered-zoom.js +1 -1
  280. package/dist/lib/prepare-prompt-files.js +1 -1
  281. package/dist/lib/reference-presentation.d.ts +38 -0
  282. package/dist/lib/reference-presentation.js +1 -0
  283. package/dist/lib/stream-style.js +1 -1
  284. package/dist/lib/streaming-markdown.js +1 -1
  285. package/dist/lib/tool-artifacts.js +1 -1
  286. package/dist/locales.d.ts +104 -0
  287. package/dist/locales.js +1 -1
  288. package/dist/oauth/claude-login.js +1 -1
  289. package/dist/oauth.js +1 -1
  290. package/dist/plugins/catalog-header.js +1 -1
  291. package/dist/plugins/catalog-skeleton.js +1 -1
  292. package/dist/plugins/host.js +1 -1
  293. package/dist/plugins/locales.js +1 -1
  294. package/dist/plugins/new-chat-directory.js +1 -1
  295. package/dist/plugins/pane.js +1 -1
  296. package/dist/plugins/panel-item.js +1 -1
  297. package/dist/plugins/plugin-detail-page.js +1 -1
  298. package/dist/plugins/plugin-icon.js +1 -1
  299. package/dist/plugins/plugin-icons.js +1 -1
  300. package/dist/plugins/plugins-page.js +1 -1
  301. package/dist/plugins/plugins.js +1 -1
  302. package/dist/plugins/read-skill-document.js +1 -1
  303. package/dist/plugins/skill-document.js +1 -1
  304. package/dist/plugins/skills-tab.js +1 -1
  305. package/dist/plugins/store.js +1 -1
  306. package/dist/plugins/toolbox-layout.js +1 -1
  307. package/dist/reference-projection.d.ts +13 -0
  308. package/dist/reference-projection.js +1 -0
  309. package/dist/search/chat-search.js +1 -1
  310. package/dist/search/codex-source-matches.js +1 -1
  311. package/dist/search/dom-matches.js +1 -1
  312. package/dist/search/find-bar.js +1 -1
  313. package/dist/search/literal-matches.js +1 -1
  314. package/dist/session-list/account-menu.js +1 -1
  315. package/dist/session-list/activity-list.js +1 -1
  316. package/dist/session-list/archived-sessions.js +1 -1
  317. package/dist/session-list/help-menu.js +1 -1
  318. package/dist/session-list/highlight.js +1 -1
  319. package/dist/session-list/host.js +1 -1
  320. package/dist/session-list/hover-info-card.js +1 -1
  321. package/dist/session-list/locales.js +1 -1
  322. package/dist/session-list/navigation-controls.js +1 -1
  323. package/dist/session-list/navigation-header.js +1 -1
  324. package/dist/session-list/navigation-store.js +1 -1
  325. package/dist/session-list/navigation-tabs.js +1 -1
  326. package/dist/session-list/navigation.js +1 -1
  327. package/dist/session-list/overflow-marquee.js +1 -1
  328. package/dist/session-list/platform.js +1 -1
  329. package/dist/session-list/session-groups.js +1 -1
  330. package/dist/session-list/session-info-card.js +1 -1
  331. package/dist/session-list/session-list.js +1 -1
  332. package/dist/session-list/session-row.js +1 -1
  333. package/dist/session-list/session-state-dot.js +1 -1
  334. package/dist/session-list/session-state-menu.js +1 -1
  335. package/dist/session-list/shortcut-hint.js +1 -1
  336. package/dist/session-list/shortcut.js +1 -1
  337. package/dist/session-list/sidebar-overlay.js +1 -1
  338. package/dist/session-list/trailing-swap.js +1 -1
  339. package/dist/session-list/use-activity-notification.js +1 -1
  340. package/dist/session-list/use-activity-preview.js +1 -1
  341. package/dist/session-list/use-cmd-held.js +1 -1
  342. package/dist/session-list/use-project-sessions.js +1 -1
  343. package/dist/session-list/virtual-session-rows.js +1 -1
  344. package/dist/session-timeline/activity-group.js +1 -1
  345. package/dist/session-timeline/activity-projection.js +1 -1
  346. package/dist/session-timeline/assistant-content.js +1 -1
  347. package/dist/session-timeline/assistant-image-references.js +1 -1
  348. package/dist/session-timeline/assistant-turn.js +1 -1
  349. package/dist/session-timeline/async-questions.js +1 -1
  350. package/dist/session-timeline/edited-files-card.js +1 -1
  351. package/dist/session-timeline/history-timeline.js +1 -1
  352. package/dist/session-timeline/host.js +1 -1
  353. package/dist/session-timeline/image-generation-progress.js +1 -1
  354. package/dist/session-timeline/navigation-rail.js +1 -1
  355. package/dist/session-timeline/plan.js +1 -1
  356. package/dist/session-timeline/question-reply.js +1 -1
  357. package/dist/session-timeline/resource-content.js +1 -1
  358. package/dist/session-timeline/session-timeline.js +1 -1
  359. package/dist/session-timeline/timeline-registry.js +1 -1
  360. package/dist/session-timeline/turn-activity.js +1 -1
  361. package/dist/session-timeline/turn-error.js +1 -1
  362. package/dist/session-timeline/turn-retry.js +1 -1
  363. package/dist/session-timeline/turn-time.js +1 -1
  364. package/dist/session-timeline/turns.js +1 -1
  365. package/dist/session-timeline/types.d.ts +1 -0
  366. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  367. package/dist/session-timeline/user-message.d.ts +2 -1
  368. package/dist/session-timeline/user-message.js +1 -1
  369. package/dist/settings/codex-account-card.js +1 -1
  370. package/dist/settings/login-card.js +1 -1
  371. package/dist/settings/model-alias-settings.js +1 -1
  372. package/dist/settings/model-aliases.js +1 -1
  373. package/dist/settings/provider-logos.js +1 -1
  374. package/dist/settings/provider-section.js +1 -1
  375. package/dist/settings/providers-port.js +1 -1
  376. package/dist/settings/providers.js +1 -1
  377. package/dist/settings/settings-bridge.js +1 -1
  378. package/dist/settings/settings.js +1 -1
  379. package/native/darwin-arm64/THIRD_PARTY_NOTICES.md +2 -2
  380. package/native/darwin-arm64/artifact.json +1 -1
  381. package/native/darwin-arm64/libalwith_native_chat.dylib +0 -0
  382. package/native/win32-x64/THIRD_PARTY_NOTICES.md +2 -2
  383. package/native/win32-x64/alwith_native_chat.dll +0 -0
  384. package/native/win32-x64/artifact.json +1 -1
  385. package/package.json +2 -2
  386. package/dist/chunk-0aqnqk7b.js +0 -2
  387. package/dist/chunk-0r4b11t4.js +0 -2
  388. package/dist/chunk-0srja8yh.js +0 -2
  389. package/dist/chunk-1647cyqx.js +0 -2
  390. package/dist/chunk-19yjze8m.js +0 -7
  391. package/dist/chunk-1axvr26t.js +0 -4
  392. package/dist/chunk-1ye5ygbk.js +0 -2
  393. package/dist/chunk-26bm75r2.js +0 -2
  394. package/dist/chunk-3kzmec3f.js +0 -2
  395. package/dist/chunk-4gstmex3.js +0 -2
  396. package/dist/chunk-52tcfvz0.js +0 -2
  397. package/dist/chunk-5q0kb3yb.js +0 -2
  398. package/dist/chunk-5y5b3w22.js +0 -2
  399. package/dist/chunk-677dyzb1.js +0 -4
  400. package/dist/chunk-6cbj9r2x.js +0 -2
  401. package/dist/chunk-6z3nch41.js +0 -1
  402. package/dist/chunk-799h4586.js +0 -2
  403. package/dist/chunk-7m08m4m1.js +0 -2
  404. package/dist/chunk-7p3nx5bx.js +0 -2
  405. package/dist/chunk-7qmj50a2.js +0 -2
  406. package/dist/chunk-7wj3dcpj.js +0 -2
  407. package/dist/chunk-844s61q1.js +0 -2
  408. package/dist/chunk-88j29hzx.js +0 -2
  409. package/dist/chunk-8pdapsc7.js +0 -2
  410. package/dist/chunk-9he6963p.js +0 -2
  411. package/dist/chunk-aardrb6e.js +0 -2
  412. package/dist/chunk-akk3k2sc.js +0 -4
  413. package/dist/chunk-b0bd8abz.js +0 -2
  414. package/dist/chunk-bv175dn9.js +0 -2
  415. package/dist/chunk-crg1ttkp.js +0 -2
  416. package/dist/chunk-der9jtk9.js +0 -2
  417. package/dist/chunk-eg9c12vk.js +0 -2
  418. package/dist/chunk-fkmka3v9.js +0 -2
  419. package/dist/chunk-fp3rp1qc.js +0 -2
  420. package/dist/chunk-gnpvd7wg.js +0 -2
  421. package/dist/chunk-h9rwby5r.js +0 -2
  422. package/dist/chunk-hhdeh622.js +0 -2
  423. package/dist/chunk-j5trhvx8.js +0 -4
  424. package/dist/chunk-kgjdh49d.js +0 -2
  425. package/dist/chunk-mz8tjgre.js +0 -2
  426. package/dist/chunk-nktaekpq.js +0 -2
  427. package/dist/chunk-nrvd7njv.js +0 -2
  428. package/dist/chunk-p95ndy0b.js +0 -3
  429. package/dist/chunk-qyj4d255.js +0 -5
  430. package/dist/chunk-r29b0ap8.js +0 -2
  431. package/dist/chunk-rgn6pdaa.js +0 -2
  432. package/dist/chunk-rwh1yvqn.js +0 -2
  433. package/dist/chunk-s267ztm1.js +0 -2
  434. package/dist/chunk-s4v10afm.js +0 -3
  435. package/dist/chunk-t3sqxded.js +0 -2
  436. package/dist/chunk-vxexg361.js +0 -2
  437. package/dist/chunk-xvfvxjyp.js +0 -4
  438. package/dist/chunk-ycj91akv.js +0 -2
  439. package/dist/chunk-ym0pvy7y.js +0 -2
  440. package/dist/chunk-z9q7rgbf.js +0 -2
  441. package/dist/chunk-zfjpfj30.js +0 -2
  442. package/dist/chunk-zyznsm1p.js +0 -2
  443. /package/native/darwin-arm64/licenses/{libsqlite3-sys-0.39.1 → libsqlite3-sys-0.40.0}/LICENSE +0 -0
  444. /package/native/darwin-arm64/licenses/{rusqlite-0.41.1 → rusqlite-0.42.0}/LICENSE +0 -0
  445. /package/native/win32-x64/licenses/{libsqlite3-sys-0.39.1 → libsqlite3-sys-0.40.0}/LICENSE +0 -0
  446. /package/native/win32-x64/licenses/{rusqlite-0.41.1 → rusqlite-0.42.0}/LICENSE +0 -0
package/README.md CHANGED
@@ -401,6 +401,69 @@ Use the matching request's error chain and proxy steps to identify the failing c
401
401
 
402
402
  Applications import protocol clients and session projections from `@alwith/module-chat/client`, conversation import utilities from `@alwith/module-chat/import`, and build-time `stageChatAdapter(directory, licenses)` from `@alwith/module-chat/stage`. The chat package owns the adapter dependency and resolves it relative to its own installation; applications must not declare it separately or reach into a hoisted `node_modules` path. Staging preserves the published adapter bytes and includes both license notices. Runtime remains responsible for process ownership.
403
403
 
404
+ ### Application tools
405
+
406
+ Pass `applicationTools` to `CodexClient` from `@alwith/module-chat/client`. Each
407
+ application owns its capabilities and data; the client owns declaration, session
408
+ binding, permission matching, dispatch, cancellation and error responses.
409
+
410
+ ```ts
411
+ const readCount = defineApplicationTool({
412
+ name: "read_count",
413
+ description: "Read the current item count",
414
+ revision: "1",
415
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
416
+ parse(input: unknown) {
417
+ if (!input || typeof input !== "object" || Array.isArray(input) || Object.keys(input).length)
418
+ throw new Error("Expected an empty object")
419
+ return undefined
420
+ },
421
+ autoApprove: () => true,
422
+ execute: async (_input, { sessionId, signal }) => ({
423
+ success: true,
424
+ contentItems: [{ type: "text", text: String(await readCountForSession(sessionId, signal)) }]
425
+ })
426
+ })
427
+ const client = new CodexClient(openPort, {
428
+ agentId: "codex",
429
+ launch: { engine: "codex" },
430
+ applicationTools: [readCount]
431
+ })
432
+ ```
433
+
434
+ `defineApplicationTool` runs the supplied parser before executing the handler and
435
+ preserves its argument type. `inputSchema` describes the same arguments to the
436
+ model; the parser enforces their business constraints. Results use the existing
437
+ `ClientToolResult` contract from `@alwith/api/tools`.
438
+
439
+ A selector can replace the array: `applicationTools: ({ cwd, operation, options }) => tools`.
440
+ It runs for new, restored and forked sessions. The client snapshots each selection
441
+ and rejects duplicate names, unavailable tools and stale revisions. Increment a
442
+ tool's `revision` when its definition or execution contract changes. The selected
443
+ set remains stable until the session is explicitly rebound; input controls and
444
+ the currently selected conversation do not change a binding. Subclasses can
445
+ compose the default selection through `applicationToolsFor`.
446
+
447
+ Omit `autoApprove` to use the normal permission UI. Automatic approval requires
448
+ adapter-provided `_meta.alwith.tool` identity matching the registered name and
449
+ set revision. Adapters without permission metadata are matched through the standard
450
+ ACP tool name and call ID in the same session's live, unfinished tool event. History,
451
+ restoring sessions, stale metadata, descriptions and translated titles cannot grant
452
+ approval. Identity checks read the current session projection rather than a delayed
453
+ UI snapshot. Tools without a matching identity continue through the normal permission UI.
454
+ A skill's enabled state does not grant permission to execute a tool.
455
+
456
+ Handlers receive `sessionId`, `turnId`, `toolCallId`, `agent` and `signal`. Pass the signal to
457
+ external operations and check it before applying changes. Session cancellation,
458
+ close, stop, rebinding, disconnection and individual `$/cancel_request` withdrawal
459
+ abort active calls; late results are discarded. Cancellation cannot undo a side
460
+ effect that already completed. Pending calls from an earlier client attachment
461
+ are not replayed. Runtime and the adapter continue to own processes and turns.
462
+
463
+ Applications that already declare raw `_meta.alwith.tools` and handle their own
464
+ calls remain supported. Do not combine raw declarations with registered tools in
465
+ the same session. New integrations should use the registry above.
466
+
404
467
  ### Existing Claude login (Bun host only)
405
468
 
406
469
  `readClaudeLogin()` and `requireClaudeAccessToken()` from `@alwith/module-chat/oauth`
@@ -1 +1 @@
1
- import{gr,u,A}from"./chunk-1647cyqx.js";export{gr as ActivityHostProvider,A as ActivityMarkdown,u as useActivityHost};
1
+ import{kr,p,E}from"./chunk-f0kgxjp1.js";export{kr as ActivityHostProvider,E as ActivityMarkdown,p as useActivityHost};
@@ -1 +1 @@
1
- import{de}from"./chunk-0srja8yh.js";export{de as AppReferenceBadge};
1
+ import{pe}from"./chunk-1e7gk302.js";import"./chunk-veb90k24.js";import"./chunk-pvd09dx5.js";export{pe as AppReferenceBadge};
@@ -0,0 +1,42 @@
1
+ import type { Agent, AgentRequest, Session, SessionOperation, SessionRequestOptions } from "@nyssance/codex-acp-v2/client";
2
+ export type { ClientToolResult as ApplicationToolResult } from "@alwith/api/tools";
3
+ import type { ClientToolResult as ApplicationToolResult, ClientToolSet } from "@alwith/api/tools";
4
+ export type ApplicationToolContext = {
5
+ sessionId: string;
6
+ toolCallId: string;
7
+ turnId: string;
8
+ signal: AbortSignal;
9
+ agent: Agent;
10
+ };
11
+ export type ApplicationTool = {
12
+ name: string;
13
+ description: string;
14
+ inputSchema: Record<string, unknown>;
15
+ revision: string;
16
+ autoApprove?: (sessionId: string) => boolean;
17
+ execute: (input: unknown, context: ApplicationToolContext) => Promise<ApplicationToolResult> | ApplicationToolResult;
18
+ };
19
+ export type ApplicationToolSelection = {
20
+ cwd: string;
21
+ operation: SessionOperation;
22
+ options: SessionRequestOptions;
23
+ };
24
+ export type ApplicationTools = readonly ApplicationTool[] | ((selection: ApplicationToolSelection) => readonly ApplicationTool[] | Promise<readonly ApplicationTool[]>);
25
+ export declare function defineApplicationTool<T>(tool: Omit<ApplicationTool, "execute"> & {
26
+ parse: (input: unknown) => T;
27
+ execute: (input: T, context: ApplicationToolContext) => Promise<ApplicationToolResult> | ApplicationToolResult;
28
+ }): ApplicationTool;
29
+ export declare function applicationToolSet(tools: readonly ApplicationTool[]): ClientToolSet;
30
+ export declare class ApplicationToolRegistry {
31
+ private readonly session;
32
+ private readonly sessions;
33
+ private readonly calls;
34
+ constructor(session: (id: string) => Session | undefined);
35
+ bind(id: string, tools: readonly ApplicationTool[], revision: string): void;
36
+ cancel(id: string): void;
37
+ drop(id: string): void;
38
+ clear(): void;
39
+ private attached;
40
+ withdraw(requestId: unknown): boolean;
41
+ handle(agent: Agent, request: AgentRequest): boolean;
42
+ }
@@ -0,0 +1 @@
1
+ import{Ir,xn,bn}from"./chunk-segftqt4.js";export{bn as ApplicationToolRegistry,xn as applicationToolSet,Ir as defineApplicationTool};
@@ -1 +1 @@
1
- import{ro,pn,Fe,St}from"../chunk-r29b0ap8.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as A}from"cn";import{useCallback as T,useEffect as I,useLayoutEffect as L,useMemo as q,useRef as G,useState as C}from"react";import{createPortal as V}from"react-dom";import{Badge as W}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as B}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as H}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Input as M}from"@nyssance/shadcn/vega/components/ui/input";import{Label as O}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as K,RadioGroupItem as _}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Textarea as X}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as s,jsxs as d}from"react/jsx-runtime";var l="__other__";function de({current:n,total:U,anchorRef:x,t:u,onAccept:P,onDecline:Q}){let p=q(()=>n?ro(n.requestedSchema):[],[n]),[b,g]=C({}),S=G(null);I(()=>{if(n?.elicitationId===void 0)return;let e={};for(let{key:r,property:i}of p)if(!Fe(i)){let c=St(i)[0];if(c)e[r]={selected:c.value}}g(e)},[n?.elicitationId,p]),I(()=>{if(n?.elicitationId!==void 0&&S.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")S.current.focus()},[n?.elicitationId]);let[w,R]=C(null),[k,z]=C(null),N=T(()=>{let e=x.current;if(!e)return;let r=e.getBoundingClientRect();if(r.width===0){let i=Math.min(640,window.innerWidth*0.9);R({left:(window.innerWidth-i)/2,width:i,bottom:24});return}R({left:r.left,width:r.width,bottom:window.innerHeight-r.bottom+20})},[x]);L(()=>{if(!n)return;let e=0,r=()=>{if(x.current){N();return}e=requestAnimationFrame(r)};return r(),()=>cancelAnimationFrame(e)},[n,N,x]),L(()=>{let e=x.current;if(!n||!e||!k)return;return j(e,k,N,{animationFrame:!0})},[n,k,x,N]);let y=q(()=>{if(!n)return!1;for(let{key:e,property:r}of p){let i=b[e];if(!i)return!1;if(Fe(r)){if(!i.selectedSet||i.selectedSet.size===0)return!1;if(i.selectedSet.has(l)&&!i.otherText?.trim())return!1}else{if(!i.selected)return!1;if(i.selected===l&&!i.otherText?.trim())return!1}}return!0},[n,p,b]),D=T(async()=>{if(!n)return;if(!y)return;let e={},r={};for(let{key:i,property:c}of p){let a=b[i];if(!a)continue;let f;if(Fe(c))e[i]=[...a.selectedSet??[]].map((m)=>m===l?(a.otherText??"").trim():m).filter(Boolean);else{let m=a.selected??"";if(e[i]=m===l?(a.otherText??"").trim():m,m!==l)f=St(c).find((t)=>t.value===m)?.preview}let v=a.notes?.trim();if(f||v)r[i]={...f&&{preview:f},...v&&{notes:v}}}await P(n.elicitationId,e,r)},[n,p,b,y,P]),F=T(async()=>{if(n)await Q(n.elicitationId)},[n,Q]);if(!n||!w)return null;return V(d("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(e)=>{if(e.key==="Escape")e.preventDefault(),F()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:w.left,width:w.width,bottom:w.bottom,maxHeight:"70vh"},ref:(e)=>{S.current=e,z(e)},children:[d("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[s("div",{className:"text-foreground text-sm font-medium",children:u("askUserQuestion.title")}),U>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${U}`})]}),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s("div",{className:"space-y-4 px-3 py-3",children:p.map(({key:e,property:r},i)=>{let c=b[e],a=c?.selected,f=c?.selectedSet??new Set,v=St(r),m=Fe(r);return d("div",{className:"space-y-2",children:[d("div",{className:"flex items-center gap-2",children:[s(W,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:pn(r).title??e}),s("div",{className:"text-foreground text-sm font-medium",children:pn(r).description})]}),m?d("div",{className:"space-y-1.5 ps-1",children:[v.map((t)=>d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(t.value),onCheckedChange:(o)=>{g((h)=>{let E=new Set(h[e]?.selectedSet??new Set);if(o)E.add(t.value);else E.delete(t.value);return{...h,[e]:{...h[e],selectedSet:E}}})}}),d("div",{className:"min-w-0 flex-1",children:[s("div",{className:"text-foreground text-sm",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs",children:t.description})]})]},t.value)),d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(l),onCheckedChange:(t)=>{g((o)=>{let h=new Set(o[e]?.selectedSet??new Set);if(t)h.add(l);else h.delete(l);return{...o,[e]:{...o[e],selectedSet:h}}})}}),s("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:u("askUserQuestion.other")})]}),f.has(l)&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}):d(K,{value:a??"",onValueChange:(t)=>g((o)=>({...o,[e]:{...o[e],selected:t}})),className:"space-y-1.5 ps-1",children:[v.map((t)=>{let o=`${i}:${t.value}`;return d("div",{className:A("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",a===t.value&&"bg-muted/60"),children:[s(_,{value:t.value,id:o}),d(O,{htmlFor:o,className:"min-w-0 flex-1 cursor-pointer",children:[s("div",{className:"text-foreground text-sm font-normal",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs font-normal",children:t.description})]})]},t.value)}),d("div",{className:A("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",a===l&&"bg-muted/60"),children:[s(_,{value:l,id:`${i}:other`,className:"mt-0.5"}),s(O,{htmlFor:`${i}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:u("askUserQuestion.other")})]}),a===l&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}),!m&&a&&a!==l&&(()=>{let t=v.find((o)=>o.value===a)?.preview;if(!t)return null;return s("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:t})})(),v.some((t)=>t.preview)&&s(X,{placeholder:u("askUserQuestion.notesPlaceholder"),value:c?.notes??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],notes:t.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},e)})})}),d("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[s(B,{variant:"ghost",size:"sm",onClick:()=>void F(),children:u("askUserQuestion.cancel")}),s(B,{size:"sm",disabled:!y,onClick:()=>void D(),children:u("askUserQuestion.submit")})]})]}),document.body)}export{de as ChoiceElicitationForm};
1
+ import{ei,An,Ve,mn}from"../chunk-9rvf1am9.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as A}from"cn";import{useCallback as T,useEffect as I,useLayoutEffect as L,useMemo as q,useRef as G,useState as C}from"react";import{createPortal as V}from"react-dom";import{Badge as W}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as B}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as H}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Input as M}from"@nyssance/shadcn/vega/components/ui/input";import{Label as O}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as K,RadioGroupItem as _}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Textarea as X}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as s,jsxs as d}from"react/jsx-runtime";var l="__other__";function de({current:n,total:U,anchorRef:x,t:u,onAccept:P,onDecline:Q}){let p=q(()=>n?ei(n.requestedSchema):[],[n]),[b,g]=C({}),S=G(null);I(()=>{if(n?.elicitationId===void 0)return;let e={};for(let{key:r,property:i}of p)if(!Ve(i)){let c=mn(i)[0];if(c)e[r]={selected:c.value}}g(e)},[n?.elicitationId,p]),I(()=>{if(n?.elicitationId!==void 0&&S.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")S.current.focus()},[n?.elicitationId]);let[w,R]=C(null),[k,z]=C(null),N=T(()=>{let e=x.current;if(!e)return;let r=e.getBoundingClientRect();if(r.width===0){let i=Math.min(640,window.innerWidth*0.9);R({left:(window.innerWidth-i)/2,width:i,bottom:24});return}R({left:r.left,width:r.width,bottom:window.innerHeight-r.bottom+20})},[x]);L(()=>{if(!n)return;let e=0,r=()=>{if(x.current){N();return}e=requestAnimationFrame(r)};return r(),()=>cancelAnimationFrame(e)},[n,N,x]),L(()=>{let e=x.current;if(!n||!e||!k)return;return j(e,k,N,{animationFrame:!0})},[n,k,x,N]);let y=q(()=>{if(!n)return!1;for(let{key:e,property:r}of p){let i=b[e];if(!i)return!1;if(Ve(r)){if(!i.selectedSet||i.selectedSet.size===0)return!1;if(i.selectedSet.has(l)&&!i.otherText?.trim())return!1}else{if(!i.selected)return!1;if(i.selected===l&&!i.otherText?.trim())return!1}}return!0},[n,p,b]),D=T(async()=>{if(!n)return;if(!y)return;let e={},r={};for(let{key:i,property:c}of p){let a=b[i];if(!a)continue;let f;if(Ve(c))e[i]=[...a.selectedSet??[]].map((m)=>m===l?(a.otherText??"").trim():m).filter(Boolean);else{let m=a.selected??"";if(e[i]=m===l?(a.otherText??"").trim():m,m!==l)f=mn(c).find((t)=>t.value===m)?.preview}let v=a.notes?.trim();if(f||v)r[i]={...f&&{preview:f},...v&&{notes:v}}}await P(n.elicitationId,e,r)},[n,p,b,y,P]),F=T(async()=>{if(n)await Q(n.elicitationId)},[n,Q]);if(!n||!w)return null;return V(d("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(e)=>{if(e.key==="Escape")e.preventDefault(),F()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:w.left,width:w.width,bottom:w.bottom,maxHeight:"70vh"},ref:(e)=>{S.current=e,z(e)},children:[d("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[s("div",{className:"text-foreground text-sm font-medium",children:u("askUserQuestion.title")}),U>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${U}`})]}),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s("div",{className:"space-y-4 px-3 py-3",children:p.map(({key:e,property:r},i)=>{let c=b[e],a=c?.selected,f=c?.selectedSet??new Set,v=mn(r),m=Ve(r);return d("div",{className:"space-y-2",children:[d("div",{className:"flex items-center gap-2",children:[s(W,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:An(r).title??e}),s("div",{className:"text-foreground text-sm font-medium",children:An(r).description})]}),m?d("div",{className:"space-y-1.5 ps-1",children:[v.map((t)=>d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(t.value),onCheckedChange:(o)=>{g((h)=>{let E=new Set(h[e]?.selectedSet??new Set);if(o)E.add(t.value);else E.delete(t.value);return{...h,[e]:{...h[e],selectedSet:E}}})}}),d("div",{className:"min-w-0 flex-1",children:[s("div",{className:"text-foreground text-sm",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs",children:t.description})]})]},t.value)),d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(l),onCheckedChange:(t)=>{g((o)=>{let h=new Set(o[e]?.selectedSet??new Set);if(t)h.add(l);else h.delete(l);return{...o,[e]:{...o[e],selectedSet:h}}})}}),s("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:u("askUserQuestion.other")})]}),f.has(l)&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}):d(K,{value:a??"",onValueChange:(t)=>g((o)=>({...o,[e]:{...o[e],selected:t}})),className:"space-y-1.5 ps-1",children:[v.map((t)=>{let o=`${i}:${t.value}`;return d("div",{className:A("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",a===t.value&&"bg-muted/60"),children:[s(_,{value:t.value,id:o}),d(O,{htmlFor:o,className:"min-w-0 flex-1 cursor-pointer",children:[s("div",{className:"text-foreground text-sm font-normal",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs font-normal",children:t.description})]})]},t.value)}),d("div",{className:A("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",a===l&&"bg-muted/60"),children:[s(_,{value:l,id:`${i}:other`,className:"mt-0.5"}),s(O,{htmlFor:`${i}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:u("askUserQuestion.other")})]}),a===l&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}),!m&&a&&a!==l&&(()=>{let t=v.find((o)=>o.value===a)?.preview;if(!t)return null;return s("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:t})})(),v.some((t)=>t.preview)&&s(X,{placeholder:u("askUserQuestion.notesPlaceholder"),value:c?.notes??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],notes:t.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},e)})})}),d("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[s(B,{variant:"ghost",size:"sm",onClick:()=>void F(),children:u("askUserQuestion.cancel")}),s(B,{size:"sm",disabled:!y,onClick:()=>void D(),children:u("askUserQuestion.submit")})]})]}),document.body)}export{de as ChoiceElicitationForm};
@@ -1 +1 @@
1
- import{ro,pn,Fe,St}from"../chunk-r29b0ap8.js";export{ro as elicitationFields,pn as elicitationLabels,St as elicitationOptions,Fe as isMultiSelect};
1
+ import{ei,An,Ve,mn}from"../chunk-9rvf1am9.js";export{ei as elicitationFields,An as elicitationLabels,mn as elicitationOptions,Ve as isMultiSelect};
@@ -1 +1 @@
1
- import{ca,hi,Oa,Ba}from"../chunk-52tcfvz0.js";export{ca as PERMISSION_KIND_GROUP_ORDER,Oa as isAllowKind,Ba as isAlwaysKind,hi as sortPermissionOptions};
1
+ import{va,Xo,za,Va}from"../chunk-vjmgh1q9.js";export{va as PERMISSION_KIND_GROUP_ORDER,za as isAllowKind,Va as isAlwaysKind,Xo as sortPermissionOptions};
@@ -1 +1 @@
1
- import{fi}from"../chunk-rq7t6qry.js";import"../chunk-52tcfvz0.js";export{fi as PermissionView};
1
+ import{Jo}from"../chunk-qdgsg6v4.js";import"../chunk-vjmgh1q9.js";export{Jo as PermissionView};
@@ -1 +1 @@
1
- import{va,da,ya,vi}from"../chunk-ehhzhjyb.js";export{vi as SchemaElicitationForm,va as elicitationFields,da as initialValues,ya as isAnswered};
1
+ import{Pa,fa,Ia,Qo}from"../chunk-vypkwd0x.js";export{Qo as SchemaElicitationForm,Pa as elicitationFields,fa as initialValues,Ia as isAnswered};
@@ -1 +1 @@
1
- import{gi}from"../chunk-j71h60r0.js";export{gi as UrlElicitationCard};
1
+ import{Yo}from"../chunk-tjfjvzv5.js";export{Yo as UrlElicitationCard};
@@ -1,2 +1,2 @@
1
- import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function yr(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function xr(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function br(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
- export{yr,xr,br};
1
+ import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function Zr(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function Qr(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function Jr(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
+ export{Zr,Qr,Jr};
@@ -1,2 +1,2 @@
1
- import{de}from"./chunk-0srja8yh.js";import{v}from"./chunk-zfjpfj30.js";import{t,vt}from"./chunk-844s61q1.js";import{isEmbeddedResource as T,isImage as y,isResourceLink as L}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as F,FileIcon as I,ImageOffIcon as U,LoaderCircleIcon as z}from"lucide-react";import{useState as C}from"react";import{Button as p}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function ma(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function j(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function ee({block:e,generated:r=!1}){let a=t(),[d,f]=C(!1),[R,B]=C(null);if(L(e)){let c=v(e.uri);if(c!==null)return n(de,{app:{id:c,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(U,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=ma(e.uri);return s(p,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(I,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!y(e))return null;let i=y(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=ma(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(p,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(I,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:w,openImageGallery:x}=a,h=x?()=>x([{src:m,alt:o,uri:i.uri}],0):w&&(()=>w(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else j(o,m)}catch(c){vt(a,c)}finally{f(!1)}},N=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(h===void 0?N:n(p,{variant:"ghost",className:r?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:h,children:N})),s(p,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(z,{className:"motion-safe:animate-spin"}):n(F,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
2
- export{ma,ee};
1
+ import{pe}from"./chunk-1e7gk302.js";import{x}from"./chunk-9h77fcpn.js";import{t,Ct}from"./chunk-xqwbn2ph.js";import{isEmbeddedResource as T,isImage as y,isResourceLink as L}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as F,FileIcon as I,ImageOffIcon as U,LoaderCircleIcon as z}from"lucide-react";import{useState as C}from"react";import{Button as p}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function ka(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function j(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function ne({block:e,generated:r=!1}){let a=t(),[d,f]=C(!1),[R,B]=C(null);if(L(e)){let c=x(e.uri);if(c!==null)return n(pe,{app:{id:c,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(U,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=ka(e.uri);return s(p,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(I,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!y(e))return null;let i=y(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=ka(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(p,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(I,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:w,openImageGallery:v}=a,h=v?()=>v([{src:m,alt:o,uri:i.uri}],0):w&&(()=>w(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else j(o,m)}catch(c){Ct(a,c)}finally{f(!1)}},N=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(h===void 0?N:n(p,{variant:"ghost",className:r?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:h,children:N})),s(p,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(z,{className:"motion-safe:animate-spin"}):n(F,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
2
+ export{ka,ne};
@@ -1,2 +1,2 @@
1
- import{A}from"./chunk-1647cyqx.js";import{t}from"./chunk-844s61q1.js";import{ee}from"./chunk-2s5598rk.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(A,{text:e.text,streaming:o})})}if(i.isImage(e))return n(ee,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(ee,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function Ne({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
2
- export{Ne};
1
+ import{E}from"./chunk-f0kgxjp1.js";import{t}from"./chunk-xqwbn2ph.js";import{ne}from"./chunk-0307kp7e.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(E,{text:e.text,streaming:o})})}if(i.isImage(e))return n(ne,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(ne,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function Ae({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
2
+ export{Ae};
@@ -1,2 +1,2 @@
1
- import{De,Ut}from"./chunk-kgjdh49d.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function bo(o){if(o===null||o===void 0)return De();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function Mr(o,{reportError:t=console.error}={}){let e=S(De()),r=async()=>{e.setState(bo(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(Ut,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function Ar({store:o,children:t}){return w(f,{value:o,children:t})}function fn(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function ve(o){let{store:t}=fn(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function oe(){return fn().dispatch}
2
- export{bo,Mr,Ar,fn,ve,oe};
1
+ import{Ue,Kt}from"./chunk-p0d6rr6q.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function Do(o){if(o===null||o===void 0)return Ue();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function oa(o,{reportError:t=console.error}={}){let e=S(Ue()),r=async()=>{e.setState(Do(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(Kt,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function ia({store:o,children:t}){return w(f,{value:o,children:t})}function Pn(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function Ie(o){let{store:t}=Pn(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function se(){return Pn().dispatch}
2
+ export{Do,oa,ia,Pn,Ie,se};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-844s61q1.js";import{e}from"./chunk-rvjfb004.js";import{h,Z}from"./chunk-7qmj50a2.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=h(a.configOptions,"model");return t===void 0?void 0:Z(t)}function Oe(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=h(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,x=7,b=2*Math.PI*x,N=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||N+k+g+w,R=N+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(N)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],v=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:Oe(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var Yt=W(_);
2
- export{Oe,Yt};
1
+ import{o}from"./chunk-xqwbn2ph.js";import{e}from"./chunk-pwcw4zp2.js";import{v,Q}from"./chunk-xmks1g9y.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=v(a.configOptions,"model");return t===void 0?void 0:Q(t)}function ze(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=v(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,x=7,b=2*Math.PI*x,h=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||h+k+g+w,R=h+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(h)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],N=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[N!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:N,children:N})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:ze(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var un=W(_);
2
+ export{ze,un};
@@ -1,2 +1,2 @@
1
- import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function Di(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
2
- export{Di};
1
+ import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function ji(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
2
+ export{ji};
@@ -1,2 +1,2 @@
1
- import{_}from"./chunk-s267ztm1.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function Qe({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=_();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
- export{Qe};
1
+ import{T}from"./chunk-vctq22tq.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function ot({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=T();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
+ export{ot};
@@ -0,0 +1,2 @@
1
+ import{co}from"./chunk-veb90k24.js";import{XIcon as i}from"lucide-react";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as o}from"react/jsx-runtime";function pe({app:a,remove:e}){return o("span",{"data-app-reference":a.id,title:a.name,className:"inline-flex max-w-full items-baseline gap-1 align-baseline",children:[n(co,{kind:"app",name:a.name}),e&&n(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4 shrink-0","aria-label":e.label,disabled:e.disabled,onClick:e.onClick,children:n(i,{className:"size-3","aria-hidden":"true"})})]})}
2
+ export{pe};
@@ -0,0 +1,3 @@
1
+ import{d}from"./chunk-s5c2ha8t.js";import{I,m}from"./chunk-4jy404m1.js";import{kt}from"./chunk-c05dxz9x.js";import{Le,c,Fe,Ze,i}from"./chunk-95n1cpnj.js";import{B,G,ie,z,V,fe,_t}from"./chunk-fjseqvmx.js";import{ge}from"./chunk-ct0xqakr.js";import{We}from"./chunk-82xjggwn.js";import{b}from"./chunk-d924by6g.js";import{It,F}from"./chunk-j6r44m9g.js";import{j,ye}from"./chunk-qnbr2cmg.js";import{Pt}from"./chunk-d1n4w7hn.js";import{St}from"./chunk-sqm2vsf5.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as le,PlusIcon as U,PuzzleIcon as oe,RefreshCwIcon as re,SearchIcon as ce,Trash2Icon as de,XIcon as me}from"lucide-react";import{memo as ue,useDeferredValue as pe,useEffect as K,useMemo as Q,useState as C}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ve,DialogContent as xe,DialogDescription as he,DialogHeader as Ne,DialogTitle as ke,DialogTrigger as be}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Pe,DropdownMenuContent as we,DropdownMenuItem as Ce,DropdownMenuTrigger as Ie}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as W}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Se}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as Z}from"react/jsx-runtime";function O(t){return t.interface?.displayName??t.name}function X(t){return t.interface?.shortDescription??""}function De({plugin:t,marketplace:r}){let{t:p}=c(),g=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),f=i((n)=>n.install),u=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=p(g?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!g)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(N,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:g||a||u,"aria-label":o,title:u?p("plugins.disabledReason.unknown"):o,onClick:()=>void f({plugin:t,marketplace:r}).catch(()=>{}),children:g?e(E,{"aria-hidden":"true"}):e(U,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Me({plugin:t,marketplace:r,actions:p,onOpen:g}){let a=X(t),f=t.interface?.developerName,u=t.localVersion??t.version,o=[f,u?`v${u}`:null].filter(Boolean).join(" · ");return s(fe,{className:"toolbox-row relative",children:[e(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":O(t),onClick:()=>g({plugin:t,marketplace:r})}),e(z,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(F,{name:t.name})})}),s(G,{className:"pointer-events-none relative min-w-0",children:[e(_t,{className:"mb-0.5",children:O(t)}),e(ie,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(ie,{"data-toolbox-metadata":"",children:o})]}),e(B,{className:"relative w-8 shrink-0 justify-center",children:p})]})}function R(){return Ze((t)=>t.connection==="ready"&&ee(t.agent))}var D=48;function Ee({marketplace:t,plugins:r,onOpen:p}){let{t:g}=c(),a=i((n)=>n.removeMarketplace),[f,u]=C(0),o=Math.min(f,Math.max(0,Math.ceil(r.length/D)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(Pe,{children:[e(Ie,{render:e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":g("plugins.pageActions")}),children:e(le,{})}),e(we,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ce,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(de,{className:"size-3.5"}),g("plugins.marketplace.remove")]})})]})]}),e(V,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*D,(o+1)*D).map((n)=>e(Me,{onOpen:p,plugin:n,marketplace:t,actions:e(De,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>D&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(N,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>u(o-1),children:g("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/D)]}),e(N,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*D>=r.length,onClick:()=>u(o+1),children:g("plugins.nextPage")})]})]},t.name)}var ze=ue(function({query:r,onOpen:p}){let{t:g}=c(),a=i((n)=>n.marketplaces),f=i((n)=>n.featuredPluginIds),u=Q(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,O(v),X(v),v.interface?.developerName??"",...v.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),o=Q(()=>{let n=new Set(f);return u.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:k,text:y})=>r===""?v.path!==null||n.has(k.id):y.includes(r)).map(({plugin:k})=>k)}))},[u,f,r]);return s(Z,{children:[o.map(({marketplace:n,plugins:v})=>e(Ee,{marketplace:n,plugins:v,onOpen:p},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:g("plugins.empty")})]})});function Oe(){let{t}=c(),r=R(),p=i((h)=>h.addMarketplace),g=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[f,u]=C(""),[o,n]=C(!1),[v,x]=C(!1),[k,y]=C(null),T=async()=>{let h=f.trim();if(!h||o)return;n(!0),y(null);try{await p({source:h}),u(""),x(!1)}catch(S){y(S instanceof Error?S.message:String(S))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(E,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ve,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(be,{render:e(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(U,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(xe,{children:[s(Ne,{children:[e(ke,{children:t("plugins.marketplace.addTitle")}),e(he,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),T()},children:[e(Se,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(W,{id:"marketplace-source",value:f,disabled:o,onChange:(h)=>u(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),k&&e("p",{role:"alert",className:"text-destructive text-sm",children:k}),s("div",{className:"flex justify-end gap-2",children:[e(N,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(N,{type:"submit",disabled:o||f.trim()==="",children:[o&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Be({onOpen:t,query:r}){let p=R(),g=i((u)=>u.marketplaceLoadErrors),a=i((u)=>u.loading)||!p,f=pe(r.trim().toLowerCase());return e(b,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${j} flex flex-col gap-8`,children:[g.map((u)=>s("p",{className:"text-destructive px-2 text-xs",children:[u.marketplacePath,": ",u.message]},u.marketplacePath)),a?e(ge,{}):e(ze,{query:f,onOpen:t})]})})}function _r({cwd:t,active:r,extensions:p,onOpenCatalog:g}){let{t:a}=c(),f=Fe(),u=Le(f),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,k]=C("plugins"),[y,T]=C({plugins:"",skills:""}),h=x==="skills"?y.skills:y.plugins,S=(l)=>T((M)=>({...M,[x]:l})),Y=Ze((l)=>JSON.stringify([...new Set(l.sessionList.map((M)=>We(M.cwd,l.projectContext)).filter((M)=>M!==null))].toSorted())),A=JSON.stringify([...new Set([We(t,f.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),L=i((l)=>l.installed),J=a(x==="skills"?"plugins.skills.search":"plugins.search"),[P,q]=C(null),w=R();K(()=>{if(!r||!w)return;if(u.getState().loadedScope!==A)o(JSON.parse(A))},[r,w,o,A,u]),K(()=>{if(!w)return;return f.onSkillsChanged(()=>void o(void 0,{background:!0}))},[w,o,f]);let H=(l)=>{g?.(),k("plugins"),q(l)},_=(l)=>{g?.(),k(l),q(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(It,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[p&&s(m,{className:`${d} h-8 gap-2 px-2`,active:p.active,onClick:p.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(m,{className:`${d} h-8 gap-2 px-2`,active:!p?.active&&x===l&&P===null,onClick:()=>_(l),children:[l==="plugins"?e(oe,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(b,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(I,{children:!w||n&&L.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):L.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):L.map((l)=>s(m,{title:O(l.plugin),className:`${d} gap-2 px-2`,active:!p?.active&&P?.plugin.id===l.plugin.id,onClick:()=>H(l),children:[e(F,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:O(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:p?.active?p.content:s(Z,{children:[P&&e(Pt,{entry:P,onBack:()=>_("plugins")},JSON.stringify([P.marketplace.name,P.marketplace.path,P.plugin.id,t])),s("div",{hidden:P!==null,className:P?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(ye,{children:e(kt,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(ce,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(W,{className:"h-9 rounded-full ps-9 pe-9","aria-label":J,value:h,onChange:(l)=>S(l.target.value),placeholder:J}),h&&e(N,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>S(""),children:e(me,{})})]}),e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!w||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(re,{})}),x==="plugins"&&e(Oe,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(N,{size:"sm",className:"h-9",variant:"outline",disabled:n||!w,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Be,{query:y.plugins,onOpen:H})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(St,{query:y.skills,ready:w,onOpenPlugin:H})})]})]})]})})]})}
3
+ export{_r};
@@ -0,0 +1,2 @@
1
+ import{useCallback as f,useState as r}from"react";var t=new Map;function _(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
2
+ export{_};
@@ -0,0 +1,2 @@
1
+ function ft(o){return o.kind==="tool"&&o.status==="completed"&&o.toolKind!=="read"&&o.toolKind!=="search"}
2
+ export{ft};
@@ -1,2 +1,2 @@
1
- import{Do}from"./chunk-pfqz31kk.js";import{Ho,tt}from"./chunk-rtdjp07m.js";import{Button as rt}from"@nyssance/shadcn/vega/components/ui/button";import{cn as nt}from"cn";import{LoaderCircleIcon as ot,SearchIcon as lt}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as st}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function Aa(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var ct=12;function na(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?ct:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;na(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function it(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function Fo({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(it,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await Ho(d,t),t.aborted)return;if(!l)na(d,"start");if(await new Promise((et)=>requestAnimationFrame(()=>et())),t.aborted)return;let N=tt(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=tt(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(st,{children:[K==="header"&&H(rt,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(lt,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:nt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(Do,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(ot,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
2
- export{Aa,na,Fo};
1
+ import{_i}from"./chunk-gxjg94y5.js";import{Si,mt}from"./chunk-4hz2ax5w.js";import{Button as et}from"@nyssance/shadcn/vega/components/ui/button";import{cn as rt}from"cn";import{LoaderCircleIcon as nt,SearchIcon as ot}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as it}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function Ja(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var lt=12;function ba(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?lt:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;ba(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function ct(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function ki({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(ct,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await Si(d,t),t.aborted)return;if(!l)ba(d,"start");if(await new Promise((tt)=>requestAnimationFrame(()=>tt())),t.aborted)return;let N=mt(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=mt(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(it,{children:[K==="header"&&H(et,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(ot,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:rt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(_i,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(nt,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
2
+ export{Ja,ba,ki};
@@ -1,2 +1,2 @@
1
- import{$o}from"./chunk-3ab38s9g.js";import{f}from"./chunk-6cbj9r2x.js";import{cn as v}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as P}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{HoverCard as E,HoverCardContent as R,HoverCardTrigger as D}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as e,jsxs as r,Fragment as K}from"react/jsx-runtime";function F(t){return e(R,{align:"start",...t})}function Oo({data:t,t:n,className:l,...m}){let c=f(),[u,h]=P(!1),[I,d]=P(1),C=z(null),a=t.filename||"",o=(t.mediaType?.startsWith("image/")&&t.url?"image":"file")==="image",A=a||(o?n("input.image"):n("input.attachment"));return L(()=>{if(!u)return;let p=0.1,g=(i)=>Math.min(10,Math.max(0.1,i)),y=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,x=s==="+"||s==="=",H=s==="-"||s==="_",w=s==="0";if(!x&&!H&&!w)return;i.preventDefault(),d((b)=>{if(w)return 1;if(x)return g(b+p);return g(b-p)})};return window.addEventListener("keydown",y,{passive:!1}),()=>window.removeEventListener("keydown",y)},[u]),r(K,{children:[r(E,{children:[e(D,{render:r("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[r("div",{className:"relative size-5 shrink-0",children:[o?e(N,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),h(!0)},children:e("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:t.url,width:20})}):e("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:e(k,{className:"size-3"})}),r(N,{"aria-label":n("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(t.id)},type:"button",variant:"ghost",children:[e(T,{}),e("span",{className:"sr-only",children:n("input.removeAttachment")})]})]}),!o&&e("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),e(F,{className:"w-auto p-2",children:r("div",{className:"w-auto space-y-3",children:[o&&e("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:e("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:t.url,width:448})}),e("div",{className:"flex items-center gap-2.5",children:r("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[e("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")}),t.mediaType&&e("p",{className:"text-muted-foreground truncate font-mono text-xs",children:t.mediaType})]})})]})})]}),o&&t.url&&e($o,{containerRef:C,filename:a||n("input.image"),onOpenChange:h,onScaleChange:d,open:u,scale:I,url:t.url})]})}function Bo({children:t,className:n,...l}){let m=f();if(!m.files.length)return null;return e("div",{className:v("flex w-full flex-wrap items-center gap-1",n),...l,children:m.files.map((c)=>e(M,{children:t(c)},c.id))})}
2
- export{Oo,Bo};
1
+ import{yi}from"./chunk-qwtmwj5m.js";import{h}from"./chunk-5ygdb72w.js";import{cn as v}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as P}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{HoverCard as E,HoverCardContent as R,HoverCardTrigger as D}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as e,jsxs as r,Fragment as K}from"react/jsx-runtime";function F(t){return e(R,{align:"start",...t})}function hi({data:t,t:n,className:l,...m}){let c=h(),[u,f]=P(!1),[I,d]=P(1),C=z(null),a=t.filename||"",o=(t.mediaType?.startsWith("image/")&&t.url?"image":"file")==="image",A=a||(o?n("input.image"):n("input.attachment"));return L(()=>{if(!u)return;let p=0.1,g=(i)=>Math.min(10,Math.max(0.1,i)),y=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,x=s==="+"||s==="=",H=s==="-"||s==="_",w=s==="0";if(!x&&!H&&!w)return;i.preventDefault(),d((b)=>{if(w)return 1;if(x)return g(b+p);return g(b-p)})};return window.addEventListener("keydown",y,{passive:!1}),()=>window.removeEventListener("keydown",y)},[u]),r(K,{children:[r(E,{children:[e(D,{render:r("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[r("div",{className:"relative size-5 shrink-0",children:[o?e(N,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),f(!0)},children:e("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:t.url,width:20})}):e("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:e(k,{className:"size-3"})}),r(N,{"aria-label":n("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(t.id)},type:"button",variant:"ghost",children:[e(T,{}),e("span",{className:"sr-only",children:n("input.removeAttachment")})]})]}),!o&&e("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),e(F,{className:"w-auto p-2",children:r("div",{className:"w-auto space-y-3",children:[o&&e("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:e("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:t.url,width:448})}),e("div",{className:"flex items-center gap-2.5",children:r("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[e("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")}),t.mediaType&&e("p",{className:"text-muted-foreground truncate font-mono text-xs",children:t.mediaType})]})})]})})]}),o&&t.url&&e(yi,{containerRef:C,filename:a||n("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:I,url:t.url})]})}function vi({children:t,className:n,...l}){let m=h();if(!m.files.length)return null;return e("div",{className:v("flex w-full flex-wrap items-center gap-1",n),...l,children:m.files.map((c)=>e(M,{children:t(c)},c.id))})}
2
+ export{hi,vi};
@@ -0,0 +1,4 @@
1
+ import{ct,dt,hn}from"./chunk-vmg3evhm.js";import{pt,h}from"./chunk-5ygdb72w.js";import{InputGroupTextarea as R}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as M}from"cn";import{forwardRef as F,useCallback as K,useEffect as T,useImperativeHandle as L,useRef as d}from"react";import{jsx as q}from"react/jsx-runtime";var z=(c)=>!c.shiftKey,N=()=>!1,En=F(({onChange:c,onKeyDown:b,onCompositionStart:y,onCompositionEnd:I,className:E,placeholder:C,bashMode:S=!1,isSendShortcut:H=z,isNewlineShortcut:P=N,...v},k)=>{let n=pt(),p=h(),i=d(!1),s=d(!1),a=d(null),l=d(null),o=K(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||l.current!==null)return;l.current=requestAnimationFrame(()=>{l.current=null;let e=a.current;if(!e||i.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);T(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,r=new ResizeObserver(([u])=>{if(u&&u.contentRect.width!==t)t=u.contentRect.width,o()});return r.observe(e),o(),()=>{if(r.disconnect(),l.current!==null)cancelAnimationFrame(l.current);l.current=null}},[o]),T(o,[o,n?.textInput.value,v.value]);let m=S&&(n?.textInput.value??"").startsWith("!"),w=(e)=>{if(i.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||s.current)return;if(b?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
+ `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(m&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(P(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:r,selectionEnd:u,value:f}=t,g=`${f.slice(0,r)}
3
+ ${f.slice(u)}`;if(n)n.textInput.setInput(g);else t.value=g;let x=r+1;t.setSelectionRange(x,x),o();return}if(H(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let r=t.querySelector('button[type="submit"]');if(!r||r.disabled)return;t.requestSubmit(r)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&p.files.length>0){e.preventDefault();let t=p.files.at(-1);if(t)p.remove(t.id)}},A=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:r,sawNonImageFile:u}=ct(t),f=dt(t);if(r.length>0)e.preventDefault(),p.add(r);else if(u&&!f)e.preventDefault()},D=n?{value:i.current&&a.current?a.current.value:m?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=i.current?e.currentTarget.value:hn(e.currentTarget);n.textInput.setInput(m?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!i.current)hn(e.currentTarget);o(),c?.(e)}};return L(k,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>i.current||s.current,getTextarea:()=>a.current}),[]),q(R,{"data-chat-input":!0,ref:a,rows:3,className:M("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",E),name:"message",onCompositionEnd:(e)=>{i.current=!1;let t=hn(e.currentTarget);n?.textInput.setInput(m?`!${t}`:t),o(),I?.(e),s.current=!0,requestAnimationFrame(()=>{s.current=!1})},onCompositionStart:(e)=>{s.current=!1,i.current=!0,y?.(e)},onKeyDown:w,onPaste:A,placeholder:C,...v,...D})});En.displayName="PromptInputTextarea";
4
+ export{En};
@@ -0,0 +1,2 @@
1
+ import{d}from"./chunk-s5c2ha8t.js";import{s,n}from"./chunk-3t5cksae.js";import{I,f,m,ee}from"./chunk-4jy404m1.js";import{T,le,Oo}from"./chunk-vctq22tq.js";import{ot}from"./chunk-11z072sz.js";import{O,te}from"./chunk-p0d6rr6q.js";import{Ie,se}from"./chunk-05eg5p11.js";import{closestCorners as ge,DndContext as fe,KeyboardSensor as Ce,PointerSensor as ye,useSensor as V,useSensors as Se}from"@dnd-kit/core";import{SortableContext as W,sortableKeyboardCoordinates as De,useSortable as ae,verticalListSortingStrategy as X}from"@dnd-kit/sortable";import{CSS as ce}from"@dnd-kit/utilities";import{cn as F}from"cn";import{BrushCleaningIcon as we,MessageSquareIcon as ve,MoreHorizontalIcon as Ne,PencilIcon as he,PlusIcon as de,StarIcon as be,Trash2Icon as me}from"lucide-react";import{useEffect as xe,useMemo as Me,useState as L}from"react";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as Y,DialogContent as Z,DialogDescription as oe,DialogFooter as ne,DialogHeader as ie,DialogTitle as re}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as H,DropdownMenuTrigger as Re}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Pe}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a,Fragment as ze}from"react/jsx-runtime";function Te({collectionId:l,sessionId:y,children:x}){let{attributes:v,listeners:N,setNodeRef:i,transform:u,transition:g,isDragging:M}=ae({id:JSON.stringify([l,y]),data:{type:"session",collectionId:l,sessionId:y}});return e("div",{ref:i,style:{transform:ce.Transform.toString(u),transition:g},className:F("w-full min-w-0",M&&"opacity-50"),...v,...N,role:"group",children:x})}function Be({collection:l,children:y,onEdit:x,onConfirm:v,onNewChat:N}){let{t:i}=T(),u=se(),g=le(),{attributes:M,listeners:p,setNodeRef:h,transform:R,transition:P,isDragging:z}=ae({id:l.id,disabled:{draggable:l.id===O,droppable:!1},data:{type:"collection"}});return e("div",{ref:h,style:{transform:ce.Transform.toString(R),transition:P},className:F("w-full min-w-0",z&&"opacity-50"),children:e(ee,{open:!l.collapsed,onOpenChange:(c)=>g(u({type:"collapse",id:l.id,collapsed:!c})),label:te(l,i),count:l.sessionIds.length,leading:l.id===O?e(be,{className:"size-3.5"}):e(ot,{emoji:l.emoji,onChange:(c)=>g(u({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...M,...p,role:"group",children:c}),actions:a(Ee,{children:[e(Re,{onClick:(c)=>c.stopPropagation(),onPointerDown:(c)=>c.stopPropagation(),render:e(w,{variant:"ghost",size:"icon",className:"size-5","aria-label":i("collection.more",{name:te(l,i)}),children:e(Ne,{className:"size-3.5"})})}),e(ke,{children:a(Le,{children:[l.id!==O&&a(H,{onClick:x,children:[e(he,{}),i("collection.rename")]}),a(H,{onClick:N,children:[e(de,{}),i("collection.newChat")]}),a(H,{onClick:()=>v("clear"),children:[e(we,{}),i("collection.clearCollection")]}),l.id!==O&&a(H,{variant:"destructive",onClick:()=>v("delete"),children:[e(me,{}),i("collection.deleteCollection")]})]})})]}),children:y})})}function He({children:l}){return e("div",{className:"min-h-0 flex-1 overflow-y-auto ps-2 pe-0 pb-1",children:l})}function na({renderRow:l,onSelect:y,onNewChat:x,Scroll:v=He}){let N=T(),{t:i}=N,u=se(),g=le(),M=s(),{collections:p,order:h}=Ie(),R=n((o)=>o.sessionList),P=n((o)=>o.archivedSessions),z=n((o)=>o.sessionListLoaded),c=n((o)=>o.sessionListError),U=Me(()=>new Map([...P,...R].map((o)=>[o.sessionId,o])),[P,R]),_=N.isMac??Oo(),[S,E]=L(null),[k,K]=L(""),[q,j]=L(""),[D,B]=L(null),[C,J]=L(!1),pe=Se(V(ye,{activationConstraint:{distance:5}}),V(Ce,{coordinateGetter:De})),G=h.flatMap((o)=>p[o].collapsed?[]:p[o].sessionIds.flatMap((t)=>{let r=U.get(t);return r&&!r.archived?[r]:[]}));xe(()=>{let o=(t)=>{if(t.defaultPrevented||t.isComposing||t.repeat||t.shiftKey||t.altKey)return;if(_?!t.metaKey||t.ctrlKey:!t.ctrlKey||t.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(t.target instanceof HTMLElement&&(t.target.isContentEditable||t.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let r=Number(t.key)-1;if(!Number.isInteger(r)||r<0||r>8||!G[r])return;t.preventDefault(),y(G[r])};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[G,_,y]);let ue=({active:o,over:t})=>{if(t===null)return;let r=o.data.current,b=t.data.current;if(r?.type==="session"&&b!==void 0){let Q=b.type==="session"?String(b.collectionId):String(t.id);g(u({type:"move",sourceCollectionId:String(r.collectionId),collectionId:Q,sessionId:String(r.sessionId),index:b.type==="session"?p[Q].sessionIds.indexOf(String(b.sessionId)):void 0}))}else if(r?.type==="collection"&&b?.type==="collection"&&String(t.id)!==O)g(u({type:"reorder",id:String(o.id),index:h.indexOf(String(t.id))}))},A=(o,t)=>{J(!0),g(o.then(t).finally(()=>J(!1)))};return a(ze,{children:[e(v,{children:a(I,{children:[a(m,{className:F(d,"font-normal"),onClick:()=>{E("new"),K(""),j("")},children:[e(f,{children:e(de,{})}),e("span",{children:i("collection.newCollection")})]}),c&&a("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:c}),e(w,{variant:"ghost",onClick:()=>g(M.listSessions({reset:!0})),children:i("collection.retry")})]}),e(fe,{sensors:pe,collisionDetection:ge,onDragEnd:ue,children:e(W,{items:h,strategy:X,children:e(I,{children:h.map((o)=>e(Be,{collection:p[o],onNewChat:()=>x(o),onEdit:()=>{E(o),K(p[o].name),j(p[o].emoji??"")},onConfirm:(t)=>B({id:o,type:t}),children:e(W,{items:p[o].sessionIds.map((t)=>JSON.stringify([o,t])),strategy:X,children:p[o].sessionIds.map((t)=>{let r=U.get(t);if(r?.archived)return null;if(!r)return z?a("div",{className:"text-muted-foreground flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-sm font-normal",children:[e(f,{children:e(ve,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(w,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>g(u({type:"remove",sessionId:t,collectionId:o})),children:e(me,{})})]},t):null;return e(Te,{collectionId:o,sessionId:t,children:l(r,()=>{},o)},t)})})},o))})})})]})}),e(Y,{open:S!==null,onOpenChange:(o)=>{if(!o&&!C)E(null)},children:a(Z,{children:[a(ie,{children:[e(re,{children:i(S==="new"?"collection.newCollection":"collection.rename")}),e(oe,{children:i("collection.collectionName")})]}),a("form",{onSubmit:(o)=>{if(o.preventDefault(),S===null||!k.trim()||C)return;let t=S==="new"?`collection-${crypto.randomUUID()}`:S;A(u([S==="new"?{type:"create",id:t,name:k}:{type:"rename",id:t,name:k},{type:"emoji",id:t,emoji:q}]),()=>E(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:k,onChange:(o)=>K(o.target.value),disabled:C}),S!=="new"&&e(ot,{emoji:q,onChange:j}),a(ne,{children:[e(w,{type:"button",variant:"outline",disabled:C,onClick:()=>E(null),children:i("collection.cancel")}),e(w,{type:"submit",disabled:C||!k.trim(),children:i("collection.confirm")})]})]})]})}),e(Y,{open:D!==null,onOpenChange:(o)=>{if(!o&&!C)B(null)},children:a(Z,{children:[a(ie,{children:[e(re,{children:i(D?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(oe,{children:i("collection.confirmCollectionChange",{name:D===null?"":te(p[D.id],i)})})]}),a(ne,{children:[e(w,{variant:"outline",disabled:C,onClick:()=>B(null),children:i("collection.cancel")}),e(w,{disabled:C,onClick:()=>{if(D!==null)A(u({type:D.type,id:D.id}),()=>B(null))},children:i("collection.confirm")})]})]})})]})}
2
+ export{na};
@@ -0,0 +1,2 @@
1
+ import{E}from"./chunk-f0kgxjp1.js";import{de}from"./chunk-bqbpded2.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function ir({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(E,{text:t.content,streaming:!1})});if(!n(t))return null;return e(de,{entries:t.entries})}
2
+ export{ir};
@@ -1,2 +1,2 @@
1
- var r=new Map,i=new Map,m=new Map;function pi(e,t){if(i.has(e))throw Error("An attachment writer is already registered for this session");return i.set(e,t),()=>{if(i.get(e)===t)i.delete(e)}}function K(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),i.get(e)?.(n)}function on(e,t){m.set(e,t),t.finally(()=>{if(m.get(e)===t)m.delete(e)})}async function ia(e){for(;;){let n=r.get(e)?.attachments.flatMap((p)=>{let c=m.get(p.id);return c?[c]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let p=await fetch(n.url);if(!p.ok)throw Error("Cannot read draft image");let c=await p.blob(),f=await new Promise((l,g)=>{let a=new FileReader;a.onload=()=>l(a.result),a.onerror=()=>g(a.error),a.readAsDataURL(c)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function ra(e,t){if(t===null)r.delete(e);else r.set(e,t)}var s=new Map;function rn(e,t){if(s.has(e))throw Error("A composer is already registered for this session");return s.set(e,t),()=>{if(s.get(e)===t)s.delete(e)}}function aa(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=s.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}
2
- export{r,pi,K,on,ia,ra,rn,aa};
1
+ var r=new Map,i=new Map,m=new Map;function qo(e,t){if(i.has(e))throw Error("An attachment writer is already registered for this session");return i.set(e,t),()=>{if(i.get(e)===t)i.delete(e)}}function W(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),i.get(e)?.(n)}function ln(e,t){m.set(e,t),t.finally(()=>{if(m.get(e)===t)m.delete(e)})}async function ua(e){for(;;){let n=r.get(e)?.attachments.flatMap((p)=>{let c=m.get(p.id);return c?[c]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let p=await fetch(n.url);if(!p.ok)throw Error("Cannot read draft image");let c=await p.blob(),f=await new Promise((l,g)=>{let a=new FileReader;a.onload=()=>l(a.result),a.onerror=()=>g(a.error),a.readAsDataURL(c)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function pa(e,t){if(t===null)r.delete(e);else r.set(e,t)}var s=new Map;function cn(e,t){if(s.has(e))throw Error("A composer is already registered for this session");return s.set(e,t),()=>{if(s.get(e)===t)s.delete(e)}}function ma(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=s.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}
2
+ export{r,qo,W,ln,ua,pa,cn,ma};
@@ -1,2 +1,2 @@
1
- import{ue}from"./chunk-fgre64ge.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=ue();function Vn(f,m){let i=new Set;for(let e of m){if(e.kind!=="tool"||e.status!=="completed")continue;let o=e.content.filter(u);if(!o.some((n)=>c(n.content)))continue;o.forEach((n,a)=>{if(c(n.content))i.add(`${e.id}:${a}`);if(!s(n.content))return;let r;try{r=JSON.parse(n.content.text)}catch(t){if(t instanceof SyntaxError)return;throw t}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let t of r.images)if(t!==null&&typeof t==="object"&&typeof t.reference==="string")i.add(t.reference)})}if(i.size===0)return f;return f.map((e)=>{if(!s(e)||!e.text.includes("!["))return e;let o=d.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let a=0;return n.tokens.map((t)=>(a+=t.raw.length,t.type==="image"&&i.has(t.href)?"":t.raw)).join("")+n.raw.slice(a)}).join("");return o===e.text?e:{...e,text:o}}).filter((e)=>!s(e)||e.text.trim().length>0)}
2
- export{Vn};
1
+ import{me}from"./chunk-620q6hmz.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=me();function eo(f,m){let i=new Set;for(let e of m){if(e.kind!=="tool"||e.status!=="completed")continue;let o=e.content.filter(u);if(!o.some((n)=>c(n.content)))continue;o.forEach((n,a)=>{if(c(n.content))i.add(`${e.id}:${a}`);if(!s(n.content))return;let r;try{r=JSON.parse(n.content.text)}catch(t){if(t instanceof SyntaxError)return;throw t}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let t of r.images)if(t!==null&&typeof t==="object"&&typeof t.reference==="string")i.add(t.reference)})}if(i.size===0)return f;return f.map((e)=>{if(!s(e)||!e.text.includes("!["))return e;let o=d.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let a=0;return n.tokens.map((t)=>(a+=t.raw.length,t.type==="image"&&i.has(t.href)?"":t.raw)).join("")+n.raw.slice(a)}).join("");return o===e.text?e:{...e,text:o}}).filter((e)=>!s(e)||e.text.trim().length>0)}
2
+ export{eo};
@@ -0,0 +1,2 @@
1
+ import{st}from"./chunk-qm1z1zcw.js";import{je}from"./chunk-wv127h6d.js";import{l}from"./chunk-6283nzqs.js";import{h}from"./chunk-5ygdb72w.js";import{U}from"./chunk-5wsyenq9.js";import{e}from"./chunk-pwcw4zp2.js";import{BlocksIcon as Q,BookOpenIcon as Y,PaperclipIcon as Z,PlusIcon as q,SquareSlashIcon as ee}from"lucide-react";import{useEffect as j,useLayoutEffect as te,useRef as S,useState as M}from"react";import{createPortal as ne}from"react-dom";import{Button as se}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as I,Fragment as oe}from"react/jsx-runtime";function In({anchorRef:r,commands:k,disabled:i,agentDisabled:c,open:a,onCommand:E,onApp:v,focusInput:L,includeAttachment:f,query:y="",onClose:p,triggerRef:B}){let{client:g,host:N}=e(),{t:d}=N,z=h(),P=S(null),[D,C]=M(null),x=`${a}:${f}:${y}`,[G,X]=M(x);if(G!==x)X(x),C(null);let[F,H]=M([]),[O,T]=M("loading");j(()=>{if(!a||c||!g.installedApps)return;let t=!0;return T("loading"),H([]),g.installedApps().then(({apps:s})=>{if(!t)return;H(s.filter((u)=>u.enabled&&u.callable)),T("ready")},(s)=>{if(!t)return;T("error"),N.reportError?.(s)}),()=>{t=!1}},[a,c,g,N]);let K=(t)=>{if(t.disabled)return;p(),t.run(),L()},W=je(k,y,Number.MAX_SAFE_INTEGER),_=(t)=>({key:`command:${t.key}`,label:t.payload.startsWith("$")?t.label.slice(1):t.label,description:t.description,skillName:t.payload.startsWith("$")?t.payload.slice(1):void 0,disabled:i||c,run:()=>E(t.payload)}),V=st(F,y,(t)=>t.runtimeName||t.id,Number.MAX_SAFE_INTEGER).map(({item:t})=>t),R=[{id:"commands",label:d(f?"composer.attachmentsAndCommands":"composer.commands"),entries:[...f?[{key:"attachment",label:d("composer.addAttachment"),disabled:i,run:()=>z.openFileDialog()}]:[],...W.filter((t)=>!t.payload.startsWith("$")).map(_)],status:void 0},{id:"skills",label:d("composer.skills"),entries:W.filter((t)=>t.payload.startsWith("$")).map(_),status:void 0},{id:"apps",label:d("composer.apps"),entries:V.map((t)=>({key:`app:${t.id}`,label:t.runtimeName||t.id,disabled:i||c,run:()=>v({id:t.id,name:t.runtimeName||t.id})})),status:O==="loading"?d("composer.appsLoading"):O==="error"?d("composer.appsFailed"):F.length===0&&!y.trim()?d("composer.appsEmpty"):void 0}].filter((t)=>(t.id!=="apps"||!c&&Boolean(g.installedApps))&&(!y.trim()||t.entries.length>0||t.status)),m=R.flatMap((t)=>t.entries).filter((t)=>!t.disabled),b=m.some((t)=>t.key===D)?D:m[0]?.key;if(j(()=>{if(!a)return;let t=L();if(!t)throw Error("The composer input is missing");let s=(n)=>{if(n.target instanceof Node&&!P.current?.contains(n.target)&&!B?.current?.contains(n.target)&&!t.contains(n.target))p()},u=(n)=>{if(n.isComposing||n.keyCode===229)return;if(n.key==="Escape")n.preventDefault(),n.stopPropagation(),p();else if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault(),n.stopPropagation();let w=m.findIndex((J)=>J.key===b),A=Math.max(0,Math.min(m.length-1,w+(n.key==="ArrowDown"?1:-1)));if(m[A])C(m[A].key)}else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let w=m.find((A)=>A.key===b);if(w)K(w)}};if(t.addEventListener("keydown",u,!0),f)t.addEventListener("input",p);return t.addEventListener("blur",p),document.addEventListener("pointerdown",s,!0),()=>{t.removeEventListener("keydown",u,!0),t.removeEventListener("input",p),t.removeEventListener("blur",p),document.removeEventListener("pointerdown",s,!0)}},[a,b,m,L,p,f,B]),te(()=>{if(a)P.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},[a,b]),!a)return null;if(!r.current)throw Error("The composer menu anchor is missing");return ne(o("div",{className:l.position,children:o("div",{ref:P,role:"listbox","aria-label":d(f?"composer.add":"composer.commands"),onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:I("div",{className:l.list,children:[R.length===0&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:d("composer.addEmpty")}),R.map((t)=>I("div",{role:"group","aria-label":t.label,children:[o("div",{className:l.group,children:t.label}),t.entries.map((s)=>{let u=s.key==="attachment"?Z:t.id==="skills"?Y:t.id==="apps"?Q:ee,n=s.skillName===void 0?void 0:N.skillIcon?.(s.skillName);return I(se,{type:"button",variant:"ghost",role:"option",disabled:s.disabled,"aria-selected":s.key===b,onMouseEnter:()=>{if(!s.disabled)C(s.key)},onClick:()=>K(s),className:`${l.row}${s.key===b?` ${l.selected}`:""}`,children:[n?o("img",{src:n,alt:"","aria-hidden":"true",className:`${l.icon} object-contain`}):o(u,{className:l.icon}),o("span",{className:l.label,children:s.label}),s.description&&o("span",{"data-slot":"description",className:l.description,children:s.description})]},s.key)}),t.status&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:t.status})]},t.id))]})})}),r.current)}function Wo({agentControls:r,onOpenChange:k,...i}){let{host:c}=e(),a=h(),E=S(null),v=S(!1);return I(oe,{children:[o(U,{ref:E,disabled:i.disabled,"aria-label":c.t(r?"composer.add":"composer.attachImage"),title:c.t(r?"composer.add":"composer.attachImage"),"aria-haspopup":r?"listbox":void 0,"aria-expanded":r?i.open:void 0,className:"text-foreground",onPointerDown:()=>{v.current=i.open},onClick:()=>{if(r)k(!v.current),i.focusInput();else a.openFileDialog()},children:o(q,{className:"size-4"})}),r&&i.open&&o(In,{...i,includeAttachment:!0,onClose:()=>k(!1),triggerRef:E})]})}
2
+ export{In,Wo};
@@ -1,2 +1,2 @@
1
- import{I}from"./chunk-cdgfr4n0.js";import{createContext as c,useContext as p,useState as x,useSyncExternalStore as y}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as D,DialogContent as L,DialogDescription as h,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as o,jsxs as d}from"react/jsx-runtime";var S=c(null),C=c(null),v=c(null);function Qr({host:e,client:t,children:i}){let[r,l]=x(null);I(r!==null);let{t:u}=e;return o(S,{value:e,children:o(C,{value:t,children:d(v,{value:l,children:[i,o(D,{open:r!==null,onOpenChange:(f)=>!f&&l(null),children:d(L,{children:[d(P,{children:[o(H,{children:u("sessionList.deleteTitle")}),o(h,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[o(g,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),o(g,{onClick:()=>{if(r)m(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function a(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function No(){return p(S)}function s(){let e=p(C);if(e===null)throw Error("Session list client is missing");return e}function Vt(){let e=p(v);if(e===null)throw Error("Session list provider is missing");return e}function n(e){let t=s();return y((i)=>t.store.subscribe(i),()=>e(t.store.getState()),()=>e(t.store.getState()))}function m(e,t){return t.then(()=>{},(i)=>{if(e.reportError)e.reportError(i);else console.error(i)})}
2
- export{Qr,a,No,s,Vt,n,m};
1
+ import{N}from"./chunk-netp71kb.js";import{createContext as c,useContext as p,useState as x,useSyncExternalStore as y}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as D,DialogContent as L,DialogDescription as h,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as o,jsxs as d}from"react/jsx-runtime";var S=c(null),C=c(null),v=c(null);function sa({host:e,client:t,children:i}){let[r,l]=x(null);N(r!==null);let{t:u}=e;return o(S,{value:e,children:o(C,{value:t,children:d(v,{value:l,children:[i,o(D,{open:r!==null,onOpenChange:(f)=>!f&&l(null),children:d(L,{children:[d(P,{children:[o(H,{children:u("sessionList.deleteTitle")}),o(h,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[o(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),o(m,{onClick:()=>{if(r)g(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function a(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function Uo(){return p(S)}function s(){let e=p(C);if(e===null)throw Error("Session list client is missing");return e}function qt(){let e=p(v);if(e===null)throw Error("Session list provider is missing");return e}function n(e){let t=s();return y((i)=>t.store.subscribe(i),()=>e(t.store.getState()),()=>e(t.store.getState()))}function g(e,t){return t.then(()=>{},(i)=>{if(e.reportError)e.reportError(i);else console.error(i)})}
2
+ export{sa,a,Uo,s,qt,n,g};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-rvjfb004.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function It({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
2
- export{It};
1
+ import{e}from"./chunk-pwcw4zp2.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function Ft({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
2
+ export{Ft};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-844s61q1.js";import{sn}from"./chunk-26bm75r2.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function mi({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:sn(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:sn(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
2
- export{mi};
1
+ import{t}from"./chunk-xqwbn2ph.js";import{rn}from"./chunk-nxj8m5bm.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function jo({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:rn(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:rn(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
2
+ export{jo};